<template>
    <div>
        <h1>父组件</h1>
        儿子给的玩具:{{toy}}
        <Son :car="`奔驰`" @getToy = "setToy"></Son>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import Son from './son.vue';
let toy = ref('')
function setToy(value:string){
    toy.value = value
}
</script>

<style scoped>

</style>